# Contributor: Simon Zeni <simon@bl4ckb0ne.ca>
# Maintainer: Simon Zeni <simon@bl4ckb0ne.ca>
pkgname=renderdoc
pkgver=1.31
pkgrel=1
pkgdesc="Stand-alone graphics debugging tool for Vulkan and OpenGL"
url="https://renderdoc.org/"
# limited by vendored plthook version
arch="all !s390x !ppc64le !riscv64 !loongarch64"
license="MIT"
makedepends="
	autoconf
	automake
	bison
	cmake
	flex
	libx11-dev
	libxcb-dev
	pcre-dev
	python3-dev
	qt5-qtbase-dev
	qt5-qtsvg-dev
	qt5-qtx11extras-dev
	samurai
	wayland-dev
	xcb-util-keysyms-dev
	"
options="!check net" # no tests
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/baldurk/renderdoc/archive/refs/tags/v$pkgver.tar.gz
	musl-fix.patch
	no-execinfo.patch
	"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX="/usr" \
		-DVULKAN_LAYER_FOLDER="/usr/share/vulkan/implicit_layer.d" \
		-DENABLE_WAYLAND=ON \
		-DBUILD_VERSION_STABLE=ON \
		-DQMAKE_QT5_COMMAND="qmake-qt5"
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
c119fdd7f27ef4f617b5b5aad94267326f403802648d6ed0970651e48b2467729ce5768ea64c77cab337ff0bdde4c17eaa01028dfebb15568bb4500693cf6d6e  renderdoc-1.31.tar.gz
3c3e77deac500f40c0f277c0806410124a1f086376bf78bc979b86c8f3180f0d07ec35552478cd3dec591c5163f3af50942d1f9771995afc4b7d30961d79766b  musl-fix.patch
09f1c1230d855b388aacaca73e7ec8a4cde9abcb349af88c49d5763eff815ada10aa485b79636d06bb33b4f42f9099042dfede180538ea8549317da2e88c54f2  no-execinfo.patch
"
